package jianzhiOfferII;

import java.util.Locale;

//剑指 Offer II 018. 有效的回文
public class Num018_isPalindrome {

    public boolean isPalindrome(String s) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            if (Character.isLetterOrDigit(ch)){
                sb.append(Character.toLowerCase(ch));
            }
        }
        StringBuilder s1 = new StringBuilder(sb).reverse();
        return sb.toString().equals(s1.toString());



    }
}
